const url = "192.168.2.109:9092"
$(document).ready(function () {
    const socket = io(url);
    console.log(">>>>>>>>")
    socket.on("onConnect", function (data) {
        console.log("socket 已连接");
    });

    socket.on("onDisconnect", function (data) {
        console.log("已断开连接");
    });

    //监听数据
    socket.on("onEvent", function (data) {
        console.log("获取数据");
    });

    const opt = {
        sourceId: "123",
        targetId: "456",
        type: 1,
        msg: "hello"
    };
    //发送数据
    socket.emit("receive", opt);
});